package book;

/**
 * Created with IntelliJ IDEA.
 * Description:书架
 * User: LianBao
 * Date: 2024-03-10
 * Time: 12:27
 */
public class BookList {
    private Book[] books;//Book类的数组
    private int usedSize;//当前书的数量

    public BookList() {
        this.books = new Book[100];
        books[0] = new Book("西游记", "吴承恩", 99.9, "小说");
        books[1] = new Book("水浒传", "施耐庵", 99.9, "小说");
        books[2] = new Book("红楼梦", "曹雪芹", 99.9, "小说");
        books[3] = new Book("三国演义", "罗贯中", 99.9, "小说");
        this.usedSize = 4;
    }

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBook(int pos, Book book) {
        this.books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
